package com.ahclic.db.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;

import com.ahclic.db.bean.UserInfo;

public interface UserinfoDao {
	
	@Insert("Create table if not exists user("+	
	"  `user_id` int(11) NOT NULL AUTO_INCREMENT,"+
	"  `email` varchar(50) NOT NULL DEFAULT \'\',"+
	"  `password` varchar(50) NOT NULL DEFAULT \'\',"+
	"  `activation_state` int(11) NOT NULL DEFAULT \'0\',"+
	"  `activation_code` varchar(50) NOT NULL DEFAULT \'\',"+
	"  `join_time` bigint(20) NOT NULL DEFAULT \'0\',"+
	"  `username` varchar(50) NOT NULL DEFAULT \'\',"+
	"  `avatar_url` varchar(200) NOT NULL DEFAULT \'\',"+
	"  `gender` int(11) NOT NULL DEFAULT \'1\',"+
	"  `simple_desc` varchar(50) NOT NULL DEFAULT \'\',"+
	"  `position` varchar(100) NOT NULL DEFAULT \'\',"+
	"  `industry` varchar(100) NOT NULL DEFAULT \'\',"+
	"  `career` varchar(100) NOT NULL DEFAULT \'\',"+
	"  `education` varchar(100) NOT NULL DEFAULT \'\',"+
	"  `full_desc` varchar(300) NOT NULL DEFAULT \'\',"+
	"  `liked_count` int(11) NOT NULL DEFAULT \'0\',"+
	"  `collected_count` int(11) NOT NULL DEFAULT \'0\',"+
	"  `follow_count` int(11) NOT NULL DEFAULT \'0\',"+
	"  `followed_count` int(11) NOT NULL DEFAULT \'0\',"+
	"  `scaned_count` int(11) NOT NULL DEFAULT \'0\',"+
	"  `weibo_user_id` varchar(30) NOT NULL DEFAULT \'\',"+
	"  PRIMARY KEY (`user_id`)"+
	        ");"
			)
	 
   public void createTable();
	
  @Insert("insert into user(password,username,simple_desc) values(#{password},#{username},#{realname})"

     )
  @Options(useGeneratedKeys=true, keyProperty="userid")
   public void insert(UserInfo userinfo);
}
